﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="FastAddCompany.aspx.cs"
    Inherits="NJL.WebManage.Company.FastAddCompany" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .demo
        {
            position: absolute;
            background-color: #F68C19;
            height: 160px;
            width: 20px;
            text-align: center;
        }
        .demo a:link, .domo a:active, .domo a:visited, .demo a:hover
        {
            color: #ffffff;
            text-decoration: underline;
        }
    </style>
    <script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
    <script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="/Scripts/js/jquery.skygqbox.1.3.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        function check() {
            var txtName = document.getElementById("<%=txtName.ClientID %>").value;
            if (txtName == "") {
                alert("请输入名称");
                return false;
            }
            //地区选择
            var selectArea = document.getElementById("<%=ddlCity.ClientID %>");
            if (selectArea != null) {
                if (selectArea.value == "000000") {
                    alert("请选择地区");
                    return false;
                }
            }
            if (txtName.length > 25) {
                alert(" 您输入的名称字数超过25个请重新输入");
                return false;
            }
            var txtIntro = document.getElementById("<%=txtCompanyIntro.ClientID %>").value;
            if (txtIntro.length > 100) {
                alert("简介长度不要超过100个汉字");
                return false;
            }
        }

        //服务
        var service = function () {
            var hidCompanyID = document.getElementById("<%=hidCompanyID.ClientID %>").value;
            if (hidCompanyID == "0") {
                alert("请先保存商户信息哦");
                return;
            }
            $('#servicediv').skygqbox();
            document.getElementById("Iframe").src = "/Company/CompanyService.aspx?id=" + hidCompanyID;
        }
        //活动
        var active = function () {
            var hidCompanyID = document.getElementById("<%=hidCompanyID.ClientID %>").value;
            if (hidCompanyID == "0") {
                alert("请先保存商户信息哦");
                return;
            }
            $('#servicediv').skygqbox();
            document.getElementById("Iframe").src = "/Company/AddActivity.aspx?id=" + hidCompanyID;
        }
        //景点
        var ticket = function () {
            var hidCompanyID = document.getElementById("<%=hidCompanyID.ClientID %>").value;
            if (hidCompanyID == "0") {
                alert("请先保存商户信息哦");
                return;
            }
            $('#servicediv').skygqbox();
            document.getElementById("Iframe").src = "/Attractions/TicketInfo.aspx?id=" + hidCompanyID + "&typeId=2";
        }
        $(document).ready(function () {
            floatdiv();
            $('#windowopen').click(function () {
                window.open('Demo.htm', 'null', 'toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
            });

        });
        function floatdiv() {
            var scrollY = 0;
            if (document.documentElement && document.documentElement.scrollTop) {
                scrollY = document.documentElement.scrollTop;
            }
            else if (document.body && document.body.scrollTop) {
                scrollY = document.body.scrollTop;
            }
            else if (window.pageYOffset) {
                scrollY = window.pageYOffset;
            }
            else if (window.scrollY) {
                scrollY = window.scrollY;
            }
            var left = document.body.clientWidth - 20 + "px";
            document.getElementById("exampleImg").style.top = scrollY + 100 + "px";
            document.getElementById("exampleImg").style.left = left;
        }
        window.onscroll = function () {
            setTimeout(floatdiv, 200);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="gray_bd">
        <div class="table_title">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            快速添加商户
        </div>
        <div class="pad5px">
            <table align="center" cellspacing="0" style="width: 100%">
                <tr>
                    <td style="width: 10%" align="right">
                        商户类型：
                    </td>
                    <td align="left" style="width: 40%">
                        <asp:RadioButtonList ID="rblCompanyType" runat="server" CellPadding="0" CellSpacing="0"
                            RepeatDirection="Horizontal">
                            <asp:ListItem Value="1" Selected="True">农家乐</asp:ListItem>
                            <asp:ListItem Value="2">度假山庄</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td>
                    </td>
                    <td style="width: 40%">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        名称：
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" MaxLength="25"></asp:TextBox>(示例图1)
                    </td>
                    <td align="right">
                        企业简称 ：
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtCompanyNameSms" runat="server" MaxLength="6"></asp:TextBox>
                        (给商户发短信最多6个字符)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        地区：
                    </td>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlProvince" runat="server" OnSelectedIndexChanged="ddlProvince_SelectedIndexChanged"
                                    AutoPostBack="True">
                                </asp:DropDownList>
                                <asp:DropDownList ID="ddlCity" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCity_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp;
                                <asp:DropDownList ID="ddlArea" runat="server">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                    <td align="right">
                        &nbsp; 图片：
                    </td>
                    <td>
                        &nbsp;
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                        (示例图2)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;联系人：
                    </td>
                    <td>
                        <asp:TextBox ID="txtLinkman" runat="server" Width="50%" MaxLength="25"></asp:TextBox>
                        (示例图3)
                    </td>
                    <td align="right">
                        手机：
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtPhone" runat="server" Width="50%" MaxLength="11"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;电话：
                    </td>
                    <td>
                        <asp:TextBox ID="txtTel" runat="server" Width="50%" MaxLength="25"></asp:TextBox>
                    </td>
                    <td align="right">
                        QQ：
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtQQ" runat="server" Width="50%" MaxLength="10"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;MSN：
                    </td>
                    <td>
                        <asp:TextBox ID="txtMsn" runat="server" Width="50%" MaxLength="100"></asp:TextBox>
                    </td>
                    <td align="right">
                        &nbsp; 传真：
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtFax" runat="server" Width="50%" MaxLength="25"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        邮政编码：
                    </td>
                    <td>
                        <asp:TextBox ID="txtPostCode" runat="server" Width="50%" MaxLength="10"></asp:TextBox>
                    </td>
                    <td align="right">
                        地址：
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtAddress" runat="server" Width="90%" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        地图地址：
                    </td>
                    <td>
                        <asp:TextBox ID="txtMapAddress" runat="server" Width="50%" MaxLength="100"></asp:TextBox>
                        (示例图7)
                    </td>
                    <td align="right">
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp; 交通指南：
                    </td>
                    <td>
                        <asp:TextBox ID="txtJTZN" runat="server" Width="95%" TextMode="MultiLine" Height="100"></asp:TextBox>
                        (示例图6)
                    </td>
                    <td align="right">
                        &nbsp; 简介:
                    </td>
                    <td>
                        &nbsp;
                        <asp:TextBox ID="txtCompanyIntro" runat="server" Width="95%" TextMode="MultiLine"
                            Height="100"></asp:TextBox>(示例图8)
                    </td>
                </tr>
                <tr>
                    <td>
                        订票须知：
                    </td>
                    <td align="left" colspan="3">
                        <asp:TextBox ID="txtTICKET_NOTICE" runat="server" TextMode="MultiLine" Height="61px"
                            Width="100%"></asp:TextBox>(示例图9-2)
                        <script type="text/javascript">
                            CKEDITOR.replace('<%=txtTICKET_NOTICE.ClientID%>',
                            {
                                filebrowserBrowseUrl: '/ckfinder/ckfinder.html', //启用浏览功能
                                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?Type=Images',
                                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?Type=Flash',
                                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                            }
                            );
                        </script>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        企业介绍：
                    </td>
                    <td align="left" colspan="3">
                        <asp:TextBox ID="txtServiceProject" runat="server" TextMode="MultiLine" Height="61px"
                            Width="100%"></asp:TextBox>
                        <script type="text/javascript">
                            CKEDITOR.replace('<%=txtServiceProject.ClientID%>',
                            {
                                filebrowserBrowseUrl: '/ckfinder/ckfinder.html', //启用浏览功能
                                filebrowserImageBrowseUrl: '/ckfinder/ckfinder.html?Type=Images',
                                filebrowserFlashBrowseUrl: '/ckfinder/ckfinder.html?Type=Flash',
                                filebrowserUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
                                filebrowserImageUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
                                filebrowserFlashUploadUrl: '/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
                            }
                            );
                        </script>
                        (示例图11)
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Style="height: 21px"
                            Text="保存" Width="40px" OnClientClick="return check()" />&nbsp; &nbsp;
                    </td>
                    <td colspan="2">
                        <input id="btnAddService" type="button" value="添加服务" onclick="service();" />(示例图10图5)
                        <input id="btnActive" type="button" value="添加活动" onclick="active();" />(示例图4)
                        <input id="bntTicket" type="button" value="添加订票" onclick="ticket();" />(示例图9-1)
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <asp:HiddenField ID="hidCompanyID" runat="server" />
    <input id="hiddenTest" type="hidden" value="<%= GetToken() %>" name="hiddenTestN" />
    <div id="servicediv" style="padding: 10px; display: none; width: 750px">
        <iframe id="Iframe" width="750" height="350" scrolling="auto"></iframe>
    </div>
    <div id="exampleImg" class="demo">
        <a href="javascript:void(0)" id="windowopen">商户添加效果图</a>
    </div>
    </form>
</body>
</html>
